package cl.rizepe.playntest.core.views;

import java.util.ArrayList;
import java.util.List;

import playn.core.gl.GLContext;
import playn.core.gl.GroupLayerGL;

public class UpdateableGroupLayer extends GroupLayerGL implements Updateable {
	List<Updateable> updateables;
	
	public UpdateableGroupLayer(GLContext ctx, float width, float height) {
		//super(ctx,width,height);
		super(ctx);
		updateables=new ArrayList<Updateable>() ;
	}

	
	
	@Override
	public void update(float delta) {
		for(Updateable updateable : updateables)
			updateable.update(delta);

	}
	
	public void add(UpdateableLayer layer){
		super.add(layer);
		updateables.add(layer);
	}
	
	public void remove(UpdateableLayer layer){
		super.remove(layer);
		updateables.remove(layer);
	}
	

	

}
